/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.sf.nwn.jme3;

import com.jme3.material.Material;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Nehon
 */
public class MaterialManager {
    
    private static MaterialManager instance;
    private Map<String,Material> materials = new HashMap<String,Material>();
    
    protected MaterialManager(){
        
    }
        
    public static MaterialManager getInstance(){
        if(instance == null){
            instance = new MaterialManager();
        }
        return instance;
    }
    
    public void addMaterial(String name, Material m){
        materials.put(name, m);
    }
    
    public Material getMaterial(String name){
        return materials.get(name);
    }
    
    public void destroy(){        
        instance = null;
    }
    
}
